/*
 * @Author: your name
 * @Date: 2020-08-14 12:10:06
 * @LastEditTime: 2020-08-16 22:50:29
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue_shop_shop\src\router\index.js
 */
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import(/* webpackChunkName: "Login" */ '../views/login/Login.vue')
  },
  {
    path: '/home',
    name: 'Home',
    redirect: '/welcome',
    component: () => import(/* webpackChunkName: "Login" */ '../views/home/Home.vue'),
    children: [
      {
        path: '/welcome',
        component: () => import(/* webpackChunkName: "Login" */ '../views/welcome/Welcome.vue')
      },
      {
        path: '/users',
        component: () => import(/* webpackChunkName: "Login" */ '../views/user/User.vue')
      },
      {
        path: '/rights',
        component: () => import(/* webpackChunkName: "Login" */ '../views/rights/Rights.vue')
      },
      {
        path: '/roles',
        component: () => import(/* webpackChunkName: "Login" */ '../views/roles/Roles.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
export default router
